<?php

	if (!isset($_SESSION["order"])){
		require_once('cntrlr/mainpage.php');
	} else {
			if (!isset($_SESSION["login"])){
				require_once ("vw/userside/orderUserNotLoggedInView.php");
			} else {
				if (count($_SESSION["login"]->getCompanies())==0){
					$factory = Factories::Init();
					$db      = $factory->databaseObject("select", "user");
					$db->extractAllUserData($_SESSION["login"]);
				}
				require_once ("vw/userside/orderUserLoggedInView.php");
			}
			if ($_SESSION["order"]->stocksNumber()==0){
				echo  "КОШНИЦАТА Е ПРАЗНА";
			} else {
				require_once ("vw/userside/orderView.php");
			}

	}

?>
